package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TempLateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TempLateServiceImpl implements TempLateService {

    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;

    @Override
    public List<TbTypeTemplate> findAll(String name) {
        List<TbTypeTemplate> tempList = tbTypeTemplateMapper.findAll(name);
        return tempList;
    }

    @Override
    public boolean insert(TbTypeTemplate tbTypeTemplate) {
        int i = tbTypeTemplateMapper.insert(tbTypeTemplate);
        return i > 0;
    }


    @Override
    public List<TbTypeTemplate> selectById(Long id) {
        List<TbTypeTemplate> typeList = tbTypeTemplateMapper.selectByID(id);
        return typeList;
    }

    @Override
    public boolean updateInfo(TbTypeTemplate tbTypeTemplate) {
        int i = tbTypeTemplateMapper.updateByPrimaryKeySelective(tbTypeTemplate);
        return i > 0;
    }

    @Override
    public List<TbTypeTemplate> selectAll() {
        List<TbTypeTemplate> typeList = tbTypeTemplateMapper.selectByExample(null);
        return typeList;
    }

    @Override
    public boolean deleteAll(Integer[] arr) {
        boolean b = tbTypeTemplateMapper.deleteAll(arr);
        return b;
    }

    @Override
    public List<TbTypeTemplate> getBrandId(Long id) {
        List<TbTypeTemplate> list =  tbTypeTemplateMapper.getBrandId(id);
        return list;
    }
}
